#pragma once

#include "VWords.h"
#include <QString>
#include <QList>
class VProjectData;

class VFileData
{
public:
    enum VHeadFileType
    {
        STD,
        STDEX
    };

    struct VHeadFile
    {
        QString name;
        QString path;
        char type;
        VHeadFile(){}
        VHeadFile(QString name, QString path, char type)
        {
            this->name  = name;
            this->path = path;
            this->type = type;
        }
    };

public:
    explicit VFileData(QString path, QString text);
	~VFileData();
    bool _include_changed = false;
	QString _path;
	QString _name;
	QString _text;
    int _version = 0;
    uint _last_modify_time;
    bool _update = false;
    VWords* _word_data;
    QList<VHeadFile> _include_list;
    QList<VFileData*> _include_file_data_list;
    VProjectData *_project=nullptr;

	void parsing_text(QString text);
    VWords *search_of_functon(int line);
    VWords * find_function(QString name);
    bool has_main_function();

private:
    bool list_is_same(QList<VHeadFile> &list1, QList<VHeadFile> &list2);

};

